# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=sddm
pkgver=0.18.1
pkgrel=8
pkgdesc="Simple Desktop Display Manager"
url="https://github.com/sddm/sddm/"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
license="GPL-2.0-only"
depends="elogind xorg-server dbus-x11 upower"
makedepends="cmake extra-cmake-modules qt5-qtbase-dev libxcb-dev upower-dev
	elogind-dev linux-pam-dev qt5-qtdeclarative-dev qt5-qttools-dev utmps-dev
	py3-docutils"
subpackages="$pkgname-doc $pkgname-lang $pkgname-openrc"
install="sddm.pre-install"
langdir="/usr/share/sddm/translations"
pkgusers="sddm"
pkggroups="sddm"
source="$pkgname-$pkgver.tar.gz::https://github.com/sddm/sddm/archive/v$pkgver.tar.gz
	pam-path-fix.patch
	sddm.initd
	"

build() {
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_MAN_PAGES=ON \
		-DENABLE_JOURNALD=OFF \
		-DNO_SYSTEMD=ON \
		-DUSE_ELOGIND=ON \
		-DUID_MIN=500 \
		-DUID_MAX=65000
	make
}

check() {
	"$builddir"/test/ConfigurationTest
}

package() {
	DESTDIR="$pkgdir" make install
	install -Dm755 "$srcdir"/sddm.initd "$pkgdir"/etc/init.d/sddm
}

sha512sums="18d5b9ee5e4d022ac86e10cde1c70c5475aeaff86d41d8b9897bc26953f5b6d042a7fef1d6e727865ebeb003a730455656765ba53350a665891113afd4dfa7d8  sddm-0.18.1.tar.gz
f0b4eb7ef0581701157f9decc637629156f36f6711b9a4bae517f94d7a1df614c81bbd891c918f07ac50e2a3d1519c43ccb9eefd80282c95dd79eca0e8d90904  pam-path-fix.patch
8762f9f1ce4922ef1e5df9e95c403a54363faad22b5703bbb0c64998887cfc1bd31178f489208648155f032bc12aa839d8c0ce9f5c57766ffa1df75531f0ac6f  sddm.initd"
